package com.zyl.courseservice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zyl.commonbase.constant.UserConstant;
import com.zyl.courseservice.entity.TUser;
import com.zyl.courseservice.entity.vo.StudentVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 略
 * @since 2020-12-08
 */
public interface TUserMapper extends BaseMapper<TUser> {

    @Select("select t_user.*,t_grade.`grade_num`,t_college.`college_name`,t_classes.`classes_name` from \n" +
            "t_user left join t_grade on t_user.grade_id=t_grade.grade_id\n" +
            "left join t_college on t_user.college_id=t_college.college_id\n" +
            "left join t_classes on t_user.classes_id=t_classes.classes_id \n" +
            "where type="+ UserConstant.STUDEND_DEFAULT)
    List<StudentVo> getQueryStudentList(Page<StudentVo> page);
}
